import type { LanShareServerStatus, ShareFileInfo } from "@common/lan-share-types.ts";

export const LanShare = {
  startServer: (): Promise<LanShareServerStatus> => native.ipc.invoke("lanShare.startServer"),
  stopServer: (): Promise<LanShareServerStatus> => native.ipc.invoke("lanShare.stopServer"),
  getStatus: (): Promise<LanShareServerStatus> => native.ipc.invoke("lanShare.getStatus"),

  getSharedFiles: (): Promise<ShareFileInfo[]> => native.ipc.invoke("lanShare.getSharedFiles"),
  addShareFile: (file: ShareFileInfo) => native.ipc.invoke("lanShare.addShareFile", file),
  deleteShareFile: (id: string) => native.ipc.invoke("lanShare.deleteShareFile", id),
};
